package TwoAgain;

import java.util.Comparator;
import java.util.TreeSet;

public class MyTest {
    public static void main(String[] args) {
        TreeSet<Employee> treeSet = new TreeSet<Employee>(new Comparator<Employee>() {
            @Override
            public int compare(Employee o1, Employee o2) {
                if (o1.getSalary()==o2.getSalary()){
                    return Integer.parseInt(o2.getCode())-Integer.parseInt(o1.getCode());
                }
                return o2.getSalary()-o1.getSalary();
            }
        });


        IFileControl fileControl = new FileControlImpl();
        fileControl.read(treeSet,"Housework0915/src/TwoAgain/1.txt");
        fileControl.read(treeSet,"Housework0915/src/TwoAgain/2.txt");

        fileControl.write(treeSet,"Housework0915/src/TwoAgain/c.txt");
    }
}
